package com.guqj.nio.netty.pstack.pojo;

import java.util.HashMap;
import java.util.Map;

public final class Header {

	private int crcCode = 0xabef0101;
	private int length; // 消息长度
	private String sessionID; // 会话ID
	private byte type; // 消息类型
	private byte priority; // 消息 优先级
	private Map<String, Object> attachment = new HashMap<>(); // 附件

	public int getCrcCode() {
		return crcCode;
	}

	public final void setCrcCode(int crcCode) {
		this.crcCode = crcCode;
	}

	public final int getLength() {
		return length;
	}

	public final void setLength(int length) {
		this.length = length;
	}

	public final String getSessionID() {
		return sessionID;
	}

	public final void setSessionID(String sessionID) {
		this.sessionID = sessionID;
	}

	public final byte getType() {
		return type;
	}

	public final void setType(byte type) {
		this.type = type;
	}

	public final byte getPriority() {
		return priority;
	}

	public final void setPriority(byte priority) {
		this.priority = priority;
	}

	public final Map<String, Object> getAttachment() {
		return attachment;
	}

	public final void setAttachment(Map<String, Object> attachment) {
		this.attachment = attachment;
	}

	@Override
	public String toString() {
		return "Header [crcCode=" + this.crcCode + ", length=" + this.length + ", sessionID=" + this.sessionID
				+ ", type=" + this.type + ", priority=" + this.priority + ", attachment=" + this.attachment + "]";
	}

}
